clear all
set maxvar 5000

********************************************************
cd "/Users/tg2778/Dropbox/0_Reviews_RnRs/072022_JOP_Roads/v3_JOP/Replication - Roads"
log using "4_Log/12_Accountability.log"

use "1_Data/AC_pre-delim_dataset.dta", clear

egen acstateid = concat(VD01_AC_id stateid),p("_")

quietly areg change_incumbentvoteshare c.z2totalvill i.rulingparty, absorb(statedistrict2) cluster(acstateid)
quietly estimates store acpre1

quietly areg change_incumbentvoteshare c.z2totalvill##i.rulingparty, absorb(statedistrict2) cluster(acstateid)
quietly estimates store acpre2

quietly areg change_incumbentvoteshare c.z2totalvill i.rulingparty if spm==1, absorb(statedistrict2) cluster(acstateid)
quietly estimates store acpre3

quietly areg change_incumbentvoteshare c.z2totalvill##i.rulingparty if spm==1, absorb(statedistrict2) cluster(acstateid)
quietly estimates store acpre4

quietly areg change_incumbentvoteshare c.z2totalvill i.rulingparty if centrealigned==1, absorb(statedistrict2) cluster(acstateid)
quietly estimates store acpre5

quietly areg change_incumbentvoteshare c.z2totalvill##i.rulingparty if centrealigned==1, absorb(statedistrict2) cluster(acstateid)
quietly estimates store acpre6

esttab acpre* using "2_Tables/Appendix_Table_G2_1.doc", cells(b(star fmt(3)) se(par fmt(3))) varlabel(z2totalvill "Std. Δ connectivity" 1.rulingparty "Ruling party" 1.rulingparty#c.z2totalvill "Ruling party × Std. Δ connectivity") collabels(none) nomtitles mgroups("All states" "Single party majority states" "Centre-aligned states", pattern(1 0 1 0 1 0)) refcat(z2totalvill "\b{Sample: Pre-delimitation AC}\b0", nolabel) replace noomit nobase drop(_cons) rtf substitute("\fs20" "\fs16" "\fs24" "\fs20") varwidth(24) modelwidth(5) title("Attribution and Δ incumbent vote share in state elections")

************************************************************************

use "1_Data/AC_post-delim_dataset.dta", clear

egen acstateid = concat(VD01_AC_id stateid),p("_")

quietly areg change_incumbentvoteshare c.z2totalvill i.rulingparty, absorb(statedistrict2) cluster(acstateid)
quietly estimates store acpost1

quietly areg change_incumbentvoteshare c.z2totalvill##i.rulingparty, absorb(statedistrict2) cluster(acstateid)
quietly estimates store acpost2

quietly areg change_incumbentvoteshare c.z2totalvill i.rulingparty if spm==1, absorb(statedistrict2) cluster(acstateid)
quietly estimates store acpost3

quietly areg change_incumbentvoteshare c.z2totalvill##i.rulingparty if spm==1, absorb(statedistrict2) cluster(acstateid)
quietly estimates store acpost4

quietly areg change_incumbentvoteshare c.z2totalvill i.rulingparty if centrealigned==1, absorb(statedistrict2) cluster(acstateid)
quietly estimates store acpost5

quietly areg change_incumbentvoteshare c.z2totalvill##i.rulingparty if centrealigned==1, absorb(statedistrict2) cluster(acstateid)
quietly estimates store acpost6

esttab acpost* using "2_Tables/Appendix_Table_G2_1.doc", cells(b(star fmt(3)) se(par fmt(3))) varlabel(z2totalvill "Std. Δ connectivity" 1.rulingparty "Ruling party" 1.rulingparty#c.z2totalvill "Ruling party × Std. Δ connectivity") collabels(none) nomtitles nonumbers refcat(z2totalvill "\b{Sample: Post-delimitation AC}\b0", nolabel) append noomit nobase drop(_cons) rtf substitute("\fs20" "\fs16" "\fs24" "\fs20") varwidth(24) modelwidth(5) addnote("\i{Notes:}\i0 The dependent variable is change in incumbent vote share measured in %. The OLS specification is the same as in main OLS results. Standard errors are clustered at the constituency level. *** p<0.001, ** p<0.01, * p<0.05")


*********************************************************************************

use "1_Data/PC_pre-delim_dataset_select.dta", clear

egen pcstate = concat(PC_no_2001 stateid),p("_")

quietly areg change_incumbentvoteshare c.z2totalvill i.rulingparty, absorb(state2) cluster(pcstate)
quietly estimates store pcpre1

quietly areg change_incumbentvoteshare c.z2totalvill##i.rulingparty, absorb(state2) cluster(pcstate)
quietly estimates store pcpre2

quietly areg change_incumbentvoteshare c.z2totalvill i.rulingparty if spm==1, absorb(state2) cluster(pcstate)
quietly estimates store pcpre3

quietly areg change_incumbentvoteshare c.z2totalvill##i.rulingparty if spm==1, absorb(state2) cluster(pcstate)
quietly estimates store pcpre4

quietly areg change_incumbentvoteshare c.z2totalvill i.rulingparty if centrealigned==1, absorb(state2) robust
quietly estimates store pcpre5

quietly areg change_incumbentvoteshare c.z2totalvill##i.rulingparty if centrealigned==1, absorb(state2) robust
quietly estimates store pcpre6

esttab pcpre* using "2_Tables/Appendix_Table_G2_2.doc", cells(b(star fmt(3)) se(par fmt(3))) varlabel(z2totalvill "Std. Δ connectivity" 1.rulingparty "Ruling party" 1.rulingparty#c.z2totalvill "Ruling party × Std. Δ connectivity") collabels(none) nomtitles mgroups("All states" "Single party majority states" "Centre-aligned states", pattern(1 0 1 0 1 0)) refcat(z2totalvill "\b{Sample: Pre-delimitation PC}\b0", nolabel) replace noomit nobase drop(_cons) rtf substitute("\fs20" "\fs16" "\fs24" "\fs20") varwidth(24) modelwidth(5) title("Attribution and Δ incumbent vote share in national elections")

**********************************************************************************

use "1_Data/PC_post-delim_dataset_select.dta", clear

egen pcstate = concat(PC_no_2001 stateid),p("_")

quietly areg change_incumbentvoteshare c.z2totalvill i.rulingparty, absorb(state2) cluster(pcstate)
quietly estimates store pcpost1

quietly areg change_incumbentvoteshare c.z2totalvill##i.rulingparty, absorb(state2) cluster(pcstate)
quietly estimates store pcpost2

quietly areg change_incumbentvoteshare c.z2totalvill i.rulingparty if spm==1, absorb(state2) cluster(pcstate)
quietly estimates store pcpost3

quietly areg change_incumbentvoteshare c.z2totalvill##i.rulingparty if spm==1, absorb(state2) cluster(pcstate)
quietly estimates store pcpost4

quietly areg change_incumbentvoteshare c.z2totalvill i.rulingparty if centrealigned==1, absorb(state2) robust
quietly estimates store pcpost5

quietly areg change_incumbentvoteshare c.z2totalvill##i.rulingparty if centrealigned==1, absorb(state2) robust
quietly estimates store pcpost6

esttab pcpost* using "2_Tables/Appendix_Table_G2_2.doc", cells(b(star fmt(3)) se(par fmt(3))) varlabel(z2totalvill "Std. Δ connectivity" 1.rulingparty "Ruling party" 1.rulingparty#c.z2totalvill "Ruling party × Std. Δ connectivity") collabels(none) nomtitles nonumbers refcat(z2totalvill "\b{Sample: Post-delimitation PC}\b0", nolabel) append noomit nobase drop(_cons) rtf substitute("\fs20" "\fs16" "\fs24" "\fs20") varwidth(24) modelwidth(5) addnote("\i{Notes:}\i0 The dependent variable is change in incumbent vote share measured in %. The OLS specification is the same as in main OLS results. Standard errors are clustered at the constituency level. *** p<0.001, ** p<0.01, * p<0.05")

log close
